import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

import { get, post, put, del } from './utils/fetch'
Vue.prototype.aGet = get
Vue.prototype.aPost = post
Vue.prototype.aPut = put
Vue.prototype.aDel = del

import ElementUI from 'element-ui';//声明element-ui
import 'element-ui/lib/theme-chalk/index.css';//引入css样式
Vue.use(ElementUI);

Vue.config.productionTip = false

// router.beforeEach((to, next) => {
//     if (!localStorage.getItem('user')) {
//         if (to.path !== '/login') {
//             return  next('/login')
//         }
//     }
//     next()
//   })

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
